import { sourcingRequest } from '@api/service/sourcing';
// 审批流
export const getOAInfoService = (data, loadingFn) => sourcingRequest({
  url: 'sourceBill/OAQueryInfor',
  type: 'get',
  data,
  loadingFn,
})
// 查询品类
export const queryCategoryService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/getCategoryByParam',
  type: 'post',
  data,
  loadingFn,
})
// 获取品牌
export const queryBrandService = (data, loadingFn) => sourcingRequest({
  url: '/product/getBrandByName',
  type: 'post',
  data,
  loadingFn,
})
// 获取区域
export const queryAreasService = (data, loadingFn) => sourcingRequest({
  url: '/purchaseTypeConfig/getAreaEnumList',
  type: 'get',
  data,
  loadingFn,
})
// 获取部门
export const queryDeptListService = (data, loadingFn) => sourcingRequest({
  url: '/purchaseTypeConfig/getDeptList',
  type: 'post',
  data,
  loadingFn,
})
// 获取商品列表
export const querySkuService = (data, loadingFn) => sourcingRequest({
  url: 'product/getNormalSkuByParam',
  type: 'post',
  data,
  loadingFn
})
// 关联商品提交
export const associatedGoodsSubmitService = (data, loadingFn) => sourcingRequest({
  url: 'product/commitInquiryNormalRel',
  type: 'post',
  data,
  loadingFn
})
// 导出询价需求
export const exportDemandService = (data, loadingFn) => sourcingRequest({
  url: 'product/exportTemplate',
  type: 'post',
  data,
  loadingFn,
  isExport: true
})
// 智能推荐商品
export const querySmartRecommendSkuService = (data, loadingFn) => sourcingRequest({
  url: 'product/smartRecommendSku',
  type: 'get',
  data,
  loadingFn
})
// 修改品类
export const updateCategoryService = (data, loadingFn) => sourcingRequest({
  url: 'inquiry/update-category',
  type: 'post',
  data,
  loadingFn
})
// 获取销售公司
export const querySaleCompanyService = (data, loadingFn) => sourcingRequest({
  url: 'common/getCompanyList',
  type: 'get',
  data,
  loadingFn,
})
// 订货定标驳回 推荐商品
export const queryRecommendSkuService = (data, loadingFn) => sourcingRequest({
  url: 'orderInquiry/getAssociationSku',
  type: 'post',
  data,
  loadingFn,
})
// 订货定标驳回 关联商品提交
export const submitRelatedSkuService = (data, loadingFn) => sourcingRequest({
  url: 'orderInquiry/commitAssociationSku',
  type: 'post',
  data,
  loadingFn,
})
// 订货定标驳回 推荐商品一物多码
export const updateTwinsSkuBySkuRecommendService = (data, loadingFn) => sourcingRequest({
  url: 'orderInquiry/updateTwinsSkuBySkuRecommendId',
  type: 'get',
  data,
  loadingFn,
})
// 维护销售区域提示 导出功能
export const exportSaleAreaListService = (data, loadingFn) => sourcingRequest({
  url: 'product/exportSkuInfoBySkuIds',
  type: 'post',
  data,
  loadingFn,
  isExport: true
})
// 报价信息 协同供应商修改报价有效期
export const editSupplierQuoteExpireTimeService = (data, loadingFn) => sourcingRequest({
  url: 'sourceSupplier/updateSupplierQuoteExpireTime',
  type: 'post',
  data,
  loadingFn,
})
// 报价信息 协同供应商修改报价有效期
export const getSupplierQuoteExpireTimeRecordService = (data, loadingFn) => sourcingRequest({
  url: 'sourceSupplier/getSupplierQuoteExpireTimeRecord',
  type: 'get',
  data,
  loadingFn,
})

// 获取自定义筛选字段
export const getSearchFormFieldsService = (data, loadingFn) => sourcingRequest({
  url: 'queryCondition/listByMenuId',
  type: 'get',
  data,
  loadingFn,
})
// 获取全量筛选条件
export const getAllSearchFieldsService = (data, loadingFn) => sourcingRequest({
  url: 'queryCondition/getConfigByMenuId',
  type: 'get',
  data,
  loadingFn,
})
// 修改筛选条件是否展示
export const updateSearchFieldStatusService = (data, loadingFn) => sourcingRequest({
  url: 'queryCondition/saveOrUpdateConfig',
  type: 'post',
  data,
  loadingFn,
})

// 获取表格表头 - 动态表头
export const getTableColumnsService = (data, loadingFn) => sourcingRequest({
  url: 'listColumnSettings/query',
  type: 'post',
  data,
  loadingFn,
})

// 修改表格表头
export const updateTableColumnsService = (data, loadingFn) => sourcingRequest({
  url: 'listColumnSettings/update',
  type: 'post',
  data,
  loadingFn,
})

// 获取省市区
// data: { addressLevel(101, 102, 103, 104), parentAddressCode }
export const queryAddressService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseOrder/getAddressList',
  type: 'post',
  data,
  loadingFn,
})

// 获取所有省市
export const queryAllProvinceAndCityService = (data, loadingFn) => sourcingRequest({
  url: 'common/getAllProvinceAndCity',
  type: 'get',
  data,
  loadingFn,
})
